#!/bin/sh
# cpu
CPU_USAGE=$(top -bn1 | grep 'CPU:' | grep -v grep | awk '{print 100-$8}')
# mem
echo 3 > /proc/sys/vm/drop_cache
MEM_USAGE=$(free -m | awk 'NR==2{printf "%.2f", $3/$2*100}')

echo "CPU_USAGE=$CPU_USAGE"
echo "MEM_USAGE=$MEM_USAGE"